<template>
	<view class="container">
		<pyh-nv :config="config"></pyh-nv>
		<image :src="baseurl+'user/renzhengbg.png'" class="bg"></image>
		<view class="content">
			<view class="scrollBox">
				<view class="nameBox">
					<input type="text" class="name" v-model="name" placeholder="请输入业主姓名" />
				</view>
				<view class="telBox">
					<input type="text" class="tel" v-model="tel" maxlength="11" placeholder="请输入业主预留手机号" />
				</view>
				<view class="codeBox">
					<input type="text" class="code" v-model="tel" maxlength="11" placeholder="请输入验证码" />
					<view class="sendCode">
						发送验证码
					</view>
				</view>
				<!-- <view class="idcardBox">
					<input type="text" class="name" v-model="idcard" placeholder="请输入业主身份证号码" maxlength="18"/>
				</view>
				<view class="nameBox1">
					<input type="text" class="name" v-model="name1" placeholder="请输入用户姓名" />
				</view>
				<view class="renshuBox">
					<uni-data-select :clear="false" v-model="numIndex" :localdata="numArray" @change="changeNum"
						placeholder="请选择"></uni-data-select>
				</view>
				<view class="telBox">
					<input type="text" class="tel" v-model="tel" maxlength="11" placeholder="请输入用户电话" />
				</view>
				<view class="submit" @click="submit">
					提交
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseurl: this.$baseurl,
				config: {
					// back: {
					// 	hide: true
					// },
					bgColor: "transparent",
					title: " ",
					color: '#ffffff'
				},
				name: '',
				name1: '',
				idcard: '',
				tel: '',
				num: '',
				numIndex: '',
				numArray: [{
						value: 0,
						text: "本人"
					},
					{
						value: 1,
						text: "亲属"
					},
				],
			}
		},
		onLoad(options) {
			// this.id = options.id;
		},
		methods: {
			getPhoneNumber() {
				this.tel = uni.getStorageSync('phone');
			},
			changeNum(e) {
				console.log(e);
				this.numIndex = e;
			},
			submit() {
				if (this.name == '') {
					this.$u.toast('请输入业主姓名')
					return;
				}
				if (this.idcard == '') {
					this.$u.toast('请输入业主身份证号码')
					return;
				}
				if (this.name1 == '') {
					this.$u.toast('请输入用户姓名')
					return;
				}
				console.log(this.numIndex)
				if (this.numIndex === '') {
					this.$u.toast('请选择业主关系')
					return;
				}
				if (this.tel == '') {
					this.$u.toast('请填写手机号码')
					return;
				}
				// 预约
				this.$request.post(`user/proprietor_certification`, {
					proprietor_name: this.name,
					id_card: this.idcard,
					user_name: this.name1,
					relation: this.numArray[this.numIndex].text,
					phone: this.tel,
				}).then(res => {
					if (res.data.code > 0) { //预约成功
						this.$u.toast('提交成功')
					} else {
						this.$u.toast(res.data.msg)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.submit {
		width: 500rpx;
		height: 90rpx;
		border-radius: 10rpx;
		margin-left: 125rpx;
		margin-top: 100rpx;
		font-size: 28rpx;
		text-align: center;
		color: #FAFAFA;
		line-height: 90rpx;
		background-color: #4E97AD;
	}

	.idcardBox {
		width: 674rpx;
		height: 88rpx;
		margin-top: 115rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		background-color: #fff;

		.name {
			width: 100%;
			height: 100%;
			margin-left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
		}
	}

	.nameBox1 {
		width: 674rpx;
		height: 88rpx;
		margin-top: 115rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		background-color: #fff;

		.name {
			width: 100%;
			height: 100%;
			margin-left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
		}
	}

	.nameBox {
		width: 674rpx;
		height: 88rpx;
		margin-top: 140rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		background-color: #fff;

		.name {
			width: 100%;
			height: 100%;
			margin-left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
		}
	}

	.telBox {
		position: relative;
		width: 674rpx;
		height: 88rpx;
		margin-top: 115rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		background-color: #fff;

		.tel {
			position: absolute;
			width: 100%;
			height: 100%;
			left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
		}
	}

	.codeBox {
		width: 674rpx;
		height: 88rpx;
		margin-top: 25rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
	justify-content: space-between;
		.code {
			width: 440rpx;
			height: 100%;
			padding-left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
			background-color: #fff;
			border-radius: 10rpx;
		}
		.sendCode{
			width: 194rpx;
			height: 100%;
			line-height: 88rpx;
			padding-left: 10rpx;
			border: none;
			text-align: center;
			font-size: 26rpx;
			color: #fff;
			background-color: #fff;
			border-radius: 10rpx;
			background-color:#4E97AD;
		}
	}
	.timeBox,
	.renshuBox {
		width: 674rpx;
		height: 82rpx;
		margin-left: 39rpx;
		margin-top: 120rpx;
		background-color: #ffffff !important;
		border-radius: 10rpx;
		padding-left: 10rpx;

		.renshu {
			margin-left: 35rpx;
			width: 100%;
			height: 100%;
			font-size: 22rpx;
			text-align: left;
			color: #fff;
		}

		.uni-stat__select {
			height: 100% !important;
			width: 96%;
		}

		.uni-select {
			padding: 0;
			padding-left: 0;
			border: none !important;
		}

		.uni-select__input-placeholder {
			color: #fff;
			text-align: left;

		}

		.uni-icons {
			display: none;
		}

		.uni-select__input-text {
			color: #000 !important;
			text-align: left;
		}
	}



	.menuBox {
		position: absolute;
		width: 670rpx;
		height: 90rpx;
		background-color: #C49A69;
		margin-top: 1330rpx;
		left: 40rpx;

		.menuText {
			width: 100%;
			height: 100%;
			line-height: 90rpx;
			text-align: center;
			font-size: 30rpx;
			color: #ffffff;
		}
	}


	.scrollBox {
		position: fixed;
		width: 100%;
		height: 100vh;
		overflow-y: scroll;
	}

	.container {
		position: fixed;
		width: 100%;
		height: 100vh;
		overflow-y: hidden;
		background-color: #F5F7FB;
		overflow-x: hidden;
	}

	.bg {
		position: absolute;
		width: 750rpx;
		height: 1623rpx;
		left: 0;
		top: 0;
	}

	.content {
		position: fixed;
		width: 100%;
		height: 100vh;
		overflow: hidden;
	}
</style>